<template>
  <div>
    <!-- 文章顺序+id -->
    <h3>{{ index }}.&nbsp;{{ data.PMCID }}</h3>

    <el-row>
      <!-- 网页链接 -->
      <el-col :span="3">
        <el-link type="primary" :href="url" target="_blank"
          >点此进入原网页</el-link
        >
      </el-col>
      <!-- 本地原文链接 -->
      <el-col :span="3">
        <el-link
          class="to-article"
          type="primary"
          :href="`#/article/${data.PMCID}/`"
          target="_blank"
          >点击浏览全文</el-link
        >
      </el-col>
    </el-row>

    <!-- 句子内容 -->
    <div>{{ data.content }}</div>

    <el-divider></el-divider>
  </div>
</template>

<script>
export default {
  name: "Item",
  props: ["data", "index"],
  data() {
    return {};
  },
  computed: {
    url() {
      let _data = this.data;
      let baseURL = "https://www.ncbi.nlm.nih.gov/pmc/articles/";
      return baseURL + _data.PMCID + "/#" + _data.secID;
    },
  },
};
</script>

<style scoped>
  .el-row {
    margin-bottom: 20px;
  }
</style>